from pywebio.input import input as pywin
from pywebio.input import FLOAT, NUMBER
import pywebio.output as output
from pywebio.output import put_text
import pywebio.pin as pin
from pywebio.session import hold
from pywebio import start_server
import start

if __name__ == '__main__':
    try:
        f = open("already_entried")
    except:
        pd = input("您是否希望每次打开都询问port(Y/N):")
        if (pd == 'N' or pd == 'n'):
            port = input("请输入Port:")
            fi = open("already_entried", 'w')
            fi.write(" ")
            fi.close()
            fif = open("port.txt", 'w')
            fif.write(port)
            fif.close()
            start.start_sv(port)
        if (pd == 'Y' or pd == 'y'):
            port = input("请输入Port:")
            fif.write(port)
            start.start_sv(port)
    else:
        q = open("port.txt",'r')
        p = q.readline()
        port = int(p)
        start.start_sv(port)